package com.orhon.smartcampus.modules.systemctl.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import com.orhon.smartcampus.modules.base.entity.Schools;

import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
@Entity
@Table(name = "systemctl_schoolsettings", schema = "smartcloud", catalog = "")
public class Schoolsettings {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;
    //年级
    @Column(name = "grades", nullable = true)
    private String grades;
    //学段
    @Column(name = "periods", nullable = true)
    private String periods;
    //学科
    @Column(name = "subjects", nullable = true)
    private String subjects;
    //课程
    @Column(name = "courses", nullable = true)
    private String courses;
    //职务
    @Column(name = "duties", nullable = true)
    private String duties;
    
    @Column(name = "platform_name", nullable = true)
    private String platformName;
    
    @Column(name = "logo", nullable = true)
    private String logo;
    
    @Column(name = "favicon", nullable = true)
    private String favicon;
    
    @Column(name = "theme_settings", nullable = true)
    private String themeSettings;
    
    @Column(name = "meta", nullable = true)
    private String meta;
    
    @Column(name = "created_at", nullable = false)
    private Date createdAt;
    
    @Column(name = "updated_at", nullable = true)
    private Date updatedAt;
    
    @Column(name = "deleted_at", nullable = true)
    private Date deletedAt;
    
//    @Column(name = "school_id", nullable = true)
//    private Long school_id;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "school_id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
//    @Transient
    private Schools baseSchoolsBySchoolId;
}
